<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var a1 = prompt('有多少钱');
      if (a1 >= 2000) {
        console.log(alert('吃西餐'));
      } else if (2000 > a1 && a1 >= 1500) {
        console.log(alert('吃快餐'));
      } else if (1500 > a1 && a1 >= 1000) {
        console.log(alert('喝饮料'));
      } else if (1000 > a1 && a1 >= 500) {
        console.log(alert('棒棒糖'));
      } else if (500 > a1) {
        console.log(alert('下次把钱带购'));
      }
    </script>
  </body>
</html>
